from flask import Blueprint, jsonify

from applications.models import Sourse
from applications.schemas.app_sourse import SourseSchema

bp = Blueprint('course', __name__, url_prefix='/course')

@bp.get('/')
def video():
    data = Sourse.query.order_by(Sourse.sort).all()
    res = {
        "data": SourseSchema(many=True).dump(data)
    }
    return jsonify(res)